#ifndef THEMEMANAGER_H
#define THEMEMANAGER_H

#include <QObject>
#include <QString>
#include <QDir>
#include <QList>

/* Class for selecting themes.
 * Uses qt setStyleSheet to apply CSS-like stylesheets.
 */
class ThemeManager : public QObject {
    Q_OBJECT

    public:
        ThemeManager( QDir swDir, const QString & defaultName = "", QObject * parent = 0 ); // set directory and load default if supplied
        ~ThemeManager();

        QStringList themes();
        const QString & activeTheme();

    public slots:
        void select( const QString & name ); // set active stylesheet
        void loadThemes();
        void restoreTheme( const QString & defaultTheme );
        void saveTheme();

    private:
        QString styleSheetContent( QString name ); // get stylesheet file content

        QString mActiveTheme;
        QDir mDirectory; // themes directory
        QStringList mThemes;
};

#endif
